from conftest import client


async def test_register():
    resp = client.post("/auth/reg", json={
        "email": "string@gmail.com",
        "password": "super_secret_password"
    })

    assert resp.status_code == 200, "Client is not registered"


async def test_auth():
    resp = client.post("/auth/auth", json={
        "email": "string@gmail.com",
        "password": "super_secret_password"
    })

    client.cookies["token"] = resp.json()["token"]

    assert resp.status_code == 200, "Client is not authorized"
    assert "token" in resp.json(), "Hasn't return token"
